package com.recsmile.sgs.entity;

import com.recsmile.sgs.core.Player;
import com.recsmile.sgs.listener.CardDisposalListener;
import com.recsmile.sgs.listener.CardOnHandListener;
import com.recsmile.sgs.listener.EquipmentListener;
import com.recsmile.sgs.listener.HealthListener;

/**
 * Created by Administrator on 2016/8/29.
 */
public class PlayerSimple extends Player{
    private CardDisposalListener cardDisposalListener;
    private HealthListener healthListener;
    private CardOnHandListener cardsOnHandListener;
    private EquipmentListener equipmentListener;
    private int cardsCount;
    
    protected HeroOriginal hero;

    public PlayerSimple(String nickname, int location) {
        this.setNickname(nickname);
        this.setLocation(location);
    }

    public void registerCardDisposalListener(CardDisposalListener cardDisposalListener) {
        this.cardDisposalListener = cardDisposalListener;
    }

    //@Override
    public void addCard(Card card) {
        cardsCount++;
        cardsOnHandListener.onCardAdded(card);
    }

    //@Override
    public void removeCardFromHand(Card card) {
        cardsCount--;
        cardsOnHandListener.onCardRemoved(card);
    }

    public HeroOriginal getHero() {
        return hero;
    }

    public void setHero(HeroOriginal hero) {
        this.hero = hero;
    }

    public void registerCardOnHandListener(CardOnHandListener cardsOnHandListener) {
        this.cardsOnHandListener = cardsOnHandListener;
    }

    public void registerHealthListener(HealthListener listener) {
        healthListener = listener;
    }

    public void registerEquipmentListener(EquipmentListener listener) {
        equipmentListener = listener;
    }
}
